//
// Created by Administrator on 2021/5/22.
// @file OpencvDemoBase.cpp
// @author jmdvirus
// @date $YEAR-$MONTH-22 12:21:57
//

#include "OpencvDemoBase.h"

OpencvDemoBase::OpencvDemoBase()
{
    basePath = "/opt/data/testdata";
}

OpencvDemoBase::~OpencvDemoBase()
{

}

int OpencvDemoBase::SaveImage(cv::Mat &img, std::string &path)
{
    std::string savepos = basePath + "/" + path;
    printf("save image to [%s]\n", savepos.c_str());
    cv::imwrite(savepos, img);
    return 0;
}

int OpencvDemoBase::SaveImage(cv::Mat &img, const char *path)
{
    std::string newpath(path);
    return SaveImage(img, newpath);
}
